package com.shijie.sjoj.model.pojo.entity;

import com.shijie.sjoj.model.base.BasePojo;
import com.shijie.sjoj.model.pojo.base.CodeType;
import com.shijie.sjoj.model.pojo.base.Status;
import lombok.Builder;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 解题记录实体类
 *
 * @author ZSJ
 */
@Data
@Builder
public class Record implements BasePojo {

    /**
     * 解题记录id
     */
    private Long recordId;

    /**
     * 用户id
     */
    private Long userId;

    /**
     * 题目id
     */
    private Long quizId;

    /**
     * 代码
     */
    private String code;

    /**
     * 代码类型
     */
    private CodeType codeType;

    /**
     * 状态
     */
    private Status status;

    /**
     * 使用时间
     */
    private Integer useTimeMil;

    /**
     * 使用内存
     */
    private Integer useMemoryKb;

    /**
     * 错误信息
     */
    private String errorTip;

    /**
     * 提交时间
     */
    private LocalDateTime putTime;

    public Record() {
        this.recordId = null;
        this.userId = null;
        this.quizId = null;
        this.code = null;
        this.codeType = null;
        this.status = null;
        this.useTimeMil = null;
        this.useMemoryKb = null;
        this.errorTip = null;
        this.putTime = null;
    }

    public Record(Long recordId, Long userId, Long quizId, String code, CodeType codeType, Status status,
                  Integer useTimeMil, Integer useMemoryKb, String errorTip, LocalDateTime putTime) {
        this.recordId = recordId;
        this.userId = userId;
        this.quizId = quizId;
        this.code = code;
        this.codeType = codeType;
        this.status = status;
        this.useTimeMil = useTimeMil;
        this.useMemoryKb = useMemoryKb;
        this.errorTip = errorTip;
        this.putTime = putTime;
    }


}
